
#include "../Layout/VerticalLayout.h"
#include "../Layout/HorizontalLayout.h"
#include "Application.h"
#include "Window.h"

Window::Window(const std::string & _strName)
: m_window()
{
}

Window::~Window()
{
}

bool Window::Create(const std::string & _strName, uint32 _iWidth, uint32 _iHeight)
{
	m_window.set_default_size(_iWidth, _iHeight);
	m_window.set_title(_strName.c_str());
	return true;
}

void Window::Resize(uint32 _iWidth, uint32 _iHeight)
{
	m_window.set_default_size(_iWidth, _iHeight);
}

const std::string & Window::GetName()
{
	return m_strName;
}

void Window::Loop()
{
	Gtk::Main::run(m_window);
}

void Window::SetLayout(IVerticalLayout * _pLayout)
{
	m_window.pack_start(((VerticalLayout*)_pLayout)->GetWidget(), Gtk::PACK_EXPAND_PADDING);
	m_window.add(((VerticalLayout*)_pLayout)->GetWidget());
}

void Window::SetLayout(IHorizontalLayout * _pLayout)
{
	m_window.pack_start(((HorizontalLayout*)_pLayout)->GetWidget(), Gtk::PACK_EXPAND_PADDING);
	m_window.add(((HorizontalLayout*)_pLayout)->GetWidget());
}
